#include "stdio.h"
#include "string.h"
main()
{
	int tu[257][257];
	int order[257];
	int n,num,large,low;
	int i,j,k,a,b,c;

	scanf("%d",&n);
	while (n)
	{
		memset(tu,0,sizeof(tu));
		memset(order,0,sizeof(order));
		large=1;
		for (i=1;i<=n;i++) large*=2;
		for (i=1;i<=large;i++) tu[1][i]=i;
		
		
		for (i=large/2,k=2;i>=1;i=i/2,k++)
			for (j=1;j<=i;j++)
			{
				scanf("%d",&tu[k][j]);
			}
		order[tu[n+1][1]]=1;
		for (i=n,k=2;i>=1;i--,k*=2)
		{
			for (j=1;j<=k;j++)
				if (order[tu[i][j]]==0)
				{
					order[tu[i][j]]=order[tu[i+1][(j+1)/2]]+1;
				}
		}

		
		scanf("%d",&num);
		for (b=1;b<=num;b++) 
		{
			scanf("%d",&a);
			c=0;
			for (i=n+1,k=1;i>=1;i--,k*=2)
			{
				for (j=1;j<=k;j++)
					if (tu[i][j]==a)
					{
						c=i;
						break;			
					}
				if (c) break;
			}
			low=1;
			for (j=2;j<=c;j++) low*=2;
		        low=large+1-low;	
			printf("Player %d can be ranked as high as %d or as low as %d.\n",a,order[a],low);
		
		}


		
/*		for (i=1;i<=large;i++)
		{
			for (j=1;j<=large;j++)
				printf("%d ",tu[i][j]);
			printf("\n");
		}  */
		scanf("%d",&n);
		if (n) printf("\n");
	}

}
